# 适用于显示屏无扬声器的台式电脑。且显卡为Nvidia，且显卡自带音频输出,且声卡为Realtek或者Intel集成芯片的情况！
import re

def check():
    check_data = {}
    step1 = open("/etc/udev/rules.d/90-nvidia-udev-pm-G05.rules","r")
    step2 = open("/proc/asound/card0/codec#0","r")
    if(step1 and step2):
        check_data["file_exists"] = True
        return check_data
    else:
        check_data["file_exists"] = False
        return check_data

def fix():
    step1 = open("/etc/udev/rules.d/90-nvidia-udev-pm-G05.rules","r")
    result1 = step1.readline()
    xinHao = result1.split(":")[1].strip()
    if "Realtek" in xinHao:
        id = re.search("\s\w+\s",xinHao)
	    
        #print(id[0])
        
def final():
    print("已尝试修复并备份原始文件到恢复区。")

    print("请重启电脑。")
    print("如果喇叭还是没有声音，请换个插孔试试看~~~（主机箱背面，三个孔）。")

step1 = check()
fix()
final()
# I have to check myself 是否上当了！